import Mock from 'mockjs'

// 配置Mock
Mock.setup({
  timeout: '200-600' // 设置响应时间
})

// 登录接口
Mock.mock(/\/api\/login/, 'post', {
  code: 200,
  data: {
    token: 'mock-token',
    userInfo: {
      id: 1,
      username: 'admin',
      avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
      roles: ['admin']
    }
  },
  message: '登录成功'
})

// 获取用户信息
Mock.mock(/\/api\/user\/info/, 'get', {
  code: 200,
  data: {
    id: 1,
    username: 'admin',
    avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
    roles: ['admin']
  },
  message: '获取成功'
})

// 上传头像
Mock.mock(/\/api\/upload/, 'post', {
  code: 200,
  data: {
    url: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png'
  },
  message: '上传成功'
}) 